package com.example.demo.common;

import java.util.UUID;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 马拉圈
 * Date: 2023-09-03
 * Time: 11:00
 */
public class ImageUtils {
    public static String getImageUniquePath(String originName) {
        String path = "blog_userImage/";
        // 获取唯一id
        String id = UUID.randomUUID().toString();
        //获取文件后缀
        String suffix = originName.substring(originName.lastIndexOf("."));
        //拼接
        path += id + suffix;
        return path;
    }
}
